import 'package:seedfour/generated/json/base/json_convert_content.dart';
import 'package:seedfour/app/models/invite_user_entity.dart';

InviteUserEntity $InviteUserEntityFromJson(Map<String, dynamic> json) {
  final InviteUserEntity inviteUserEntity = InviteUserEntity();
  final String? uid = jsonConvert.convert<String>(json['uid']);
  if (uid != null) {
    inviteUserEntity.uid = uid;
  }
  final String? mobile = jsonConvert.convert<String>(json['mobile']);
  if (mobile != null) {
    inviteUserEntity.mobile = mobile;
  }
  final String? name = jsonConvert.convert<String>(json['name']);
  if (name != null) {
    inviteUserEntity.name = name;
  }
  final int? referrerAt = jsonConvert.convert<int>(json['referrerAt']);
  if (referrerAt != null) {
    inviteUserEntity.referrerAt = referrerAt;
  }
  final String? startAtStr = jsonConvert.convert<String>(json['startAtStr']);
  if (startAtStr != null) {
    inviteUserEntity.startAtStr = startAtStr;
  }
  final String? endAtStr = jsonConvert.convert<String>(json['endAtStr']);
  if (endAtStr != null) {
    inviteUserEntity.endAtStr = endAtStr;
  }
  final int? no = jsonConvert.convert<int>(json['no']);
  if (no != null) {
    inviteUserEntity.no = no;
  }
  return inviteUserEntity;
}

Map<String, dynamic> $InviteUserEntityToJson(InviteUserEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['uid'] = entity.uid;
  data['mobile'] = entity.mobile;
  data['name'] = entity.name;
  data['referrerAt'] = entity.referrerAt;
  data['startAtStr'] = entity.startAtStr;
  data['endAtStr'] = entity.endAtStr;
  data['no'] = entity.no;
  return data;
}

extension InviteUserEntityExtension on InviteUserEntity {
  InviteUserEntity copyWith({
    String? uid,
    String? mobile,
    String? name,
    int? referrerAt,
    String? startAtStr,
    String? endAtStr,
    int? no,
  }) {
    return InviteUserEntity()
      ..uid = uid ?? this.uid
      ..mobile = mobile ?? this.mobile
      ..name = name ?? this.name
      ..referrerAt = referrerAt ?? this.referrerAt
      ..startAtStr = startAtStr ?? this.startAtStr
      ..endAtStr = endAtStr ?? this.endAtStr
      ..no = no ?? this.no;
  }
}